package com.lagou.module2homewor;

/**
 * 测试类
 */
public class IphoneTest {
    public static void main(String[] args) {
        //1.声明手机卡的引用指向手机卡的对象
        IphoneCard iphoneCard = new IphoneCard(IphoneCardType.BIG_CARD.toString(),"15166668888","张三","password");
        //2.打印手机卡的信息
        iphoneCard.show();

        //3.通话套餐，多态
        BasicPlan basicPlan = new CallPlan(100,500,38);
        basicPlan.show();

        //4.上网套餐，多态
        BasicPlan basicPlan2 = new InternetPlan(100,88);
        basicPlan2.show();

        //5.张三给手机卡缴费500元
        iphoneCard.setAccountBalance(500);
        iphoneCard.show();

        //6.张三使用通话套餐
        CallInterface callInterface = new CallPlan();
        callInterface.call(60,iphoneCard);

        //7.张三使用上网套餐
        OnlineInterface onlineInterface = new InternetPlan();
        onlineInterface.online(30,iphoneCard);
    }
}
